package com.fanbai.score.manage.fragment;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.fanbai.score.R;
import com.fanbai.score.common.activity.CommonList_Activity;
import com.fanbai.score.common.activity.LoginActivity;
import com.fanbai.score.common.base.BaseFragment;
import com.fanbai.score.business.activity.ActAddActivity;
import com.fanbai.score.manage.activity.SettringRatio_Activity;

import butterknife.OnClick;

/**
 * Created by acer on 2017/5/30.
 */

public class HomeFragment extends BaseFragment{

    @OnClick({R.id.manageFragmentHome_settingRatio, R.id.manageFragmentHome_shopCount, R.id.manageFragmentHome_actCount})
    public void onClick(View view){
        Bundle bundle = new Bundle();
        switch (view.getId()){
            case R.id.manageFragmentHome_settingRatio://设置系数
                ctx.jumpToActivity(SettringRatio_Activity.class);
                break;
            case R.id.manageFragmentHome_shopCount://店铺统计
                bundle.putString("status", "shopCount");
                ctx.jumpToActivity(CommonList_Activity.class, bundle);
                break;
            case R.id.manageFragmentHome_actCount://活动统计
                bundle.putString("status", "actCount");
                ctx.jumpToActivity(CommonList_Activity.class, bundle);
                break;
        }
    }
    /**
     * The fragment argument representing the section number for this
     * fragment.
     */
    private static final String ARG_SECTION_NUMBER = "section_number";
    /**
     * Returns a new instance of this fragment for the given section
     * number.
     */
    public static HomeFragment newInstance(int sectionNumber) {
        HomeFragment fragment = new HomeFragment();
        Bundle args = new Bundle();
        args.putInt(ARG_SECTION_NUMBER, sectionNumber);
        fragment.setArguments(args);
        return fragment;
    }

    public HomeFragment() {
    }
    @Override
    protected int getLayoutID() {
        return R.layout.manage_fragment_home;
    }

    @Override
    public String getTitleName() {
        return "股东";
    }

    @Override
    public void iniTitleLeft(ImageView tv) {

    }

    @Override
    public void iniTitleRight(TextView tv) {
        tv.setText("退出");
        tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ctx.jumpToActivity(LoginActivity.class);
            }
        });
    }

    @Override
    protected void initView(View view) {

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initListener() {

    }
}
